import UIKit
class People  {
    var name: String?
    var age: Int?
    var gender: String?
    
    func eat() {
        print("people can eat")
    }
    class var addr: String? {
        set {
            addr = newValue
        }
        get {
            return addr
        }
    }
}

class Girl : People {
    // override 重写gender属性
    override var gender: String? {
        set {
            gender = "famale"
        }
        get {
            return "famale";
        }
    }
    // override 重写eat方法
    override func eat() {
        super.eat()
        print("girl can eat")
    }
    
    override class var addr: String? {
        set {
            addr = super.addr
        }
        get {
            return
        }
    }
    
    class Circle {
        var radius: Int = 1
        
    }
    
    class SubCircle : Circle {
        override var radius: Int {
            willSet {
                print("SubCircle willSetRadius", newValue)
            }
            didSet {
                print("SubCircle didSetRadius", oldValue, radius)
                
            }
        }
    }
    var circle = SubCircle()
    // SubCircle willSetRadius
    
}


var girl = Girl()
Girl.addr = "火星"
print(Girl.addr)

